import 'package:flutter/foundation.dart';

class UserProvider with ChangeNotifier {
  String _userName = '';
  String _avatar = '';

  // getter
  String get userName => _userName;
  String get avatar => _avatar;

  // setter
  void setUserName(String name) {
    _userName = name;
    notifyListeners(); // 通知所有监听者数据已更新
  }

  void setAvatar(String avatarUrl) {
    _avatar = avatarUrl;
    notifyListeners();
  }
} 